<template>
<div>
  <div class="header">
    <span class="search-header">搜索用户数</span>
     <svg t="1662432581792" class="icon-info" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2372" width="32" height="32"><path d="M509.92 795.84c157.904 0 285.92-128.016 285.92-285.92C795.84 352 667.808 224 509.92 224 352 224 224 352 224 509.92c0 157.904 128 285.92 285.92 285.92z m0 48C325.504 843.84 176 694.32 176 509.92 176 325.504 325.504 176 509.92 176c184.416 0 333.92 149.504 333.92 333.92 0 184.416-149.504 333.92-333.92 333.92z m-2.448-400.704h16a16 16 0 0 1 16 16v201.728a16 16 0 0 1-16 16h-16a16 16 0 0 1-16-16V459.136a16 16 0 0 1 16-16z m0-100.176h16a16 16 0 0 1 16 16v23.648a16 16 0 0 1-16 16h-16a16 16 0 0 1-16-16v-23.648a16 16 0 0 1 16-16z" p-id="2373" fill="#8a8a8a"></path></svg>
  </div>
  <div class="main">
    <span class="main-title">12321</span>
    <span class="main-content">17.1</span>
    <i class="el-icon-caret-top" style="color: greenyellow"></i>
    <i class="el-icon-caret-bottom" style="color: red"></i>
  </div>
  <div class="footer">
    <div class="charts" ref="charts"></div>
  </div>
</div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'LineCharts' ,
   data () { 
      return {}
    },
    mounted() {
      let lineCharts = echarts.init(this.$refs.charts)
      lineCharts.setOption({
        xAxis: {
          show: false,
          type: 'category'
        },
        yAxis: {
          show: false,
        },
        // 图标距离网格的距离
        grid: {
          // show: true,
          top: 0,
          right: 0,
          bottom: 0,
          left: 0
        },
        series: [
          {
            type: 'line',
            data: [30, 35, 30, 15, 15, 50, 15, 50],
            // 隐藏拐点
            itemStyle: {
              opacity: 0
            },
            // 线条颜色
            lineStyle: {
              color: 'blue'
            },
            // 区域样式
            areaStyle: {
              // 渐变色
              color: {
                type: 'linear',
                x: 0,
                y: 0,
                x2: 0,
                y2: 1,
                colorStops: [{
                    offset: 0, color: 'blue' // 0% 处的颜色
                }, {
                    offset: 1, color: '#fff' // 100% 处的颜色
                }],
                global: false // 缺省为 false
              },
            },
            // 过渡效果
            smooth: true,
          }
        ]
      })
    }

}
</script>

<style scoped>
.icon-info {
  vertical-align: middle;
}
.search-header {
  margin-right: 20px;
}
.main {
  margin: 10px 0;
}
.main-title {
  margin-right: 30px;
}
.main-content {
  margin-right: 10px;
}
.charts{
  width: 100%;
  height: 50px;
}
</style>
